//
// Created by 田建昆 on 2020/12/22.
//

#ifndef CODEBASE_STACK_H
#define CODEBASE_STACK_H

#include <list.h>

typedef list_t l_stack;

#define stack_init list_init
#define stack_destroy list_destroy
#define stack_size list_len
#define stack_peek(l_stack) ((l_stack)->head == NULL ? NULL : (l_stack)->head->data)

int stack_push(l_stack *stack, void *data);
int stack_pop(l_stack *stack, void **data);

#endif //CODEBASE_STACK_H
